<template>
  <div class="goods-box">
    <div class="gengduo">
      <div v-for="(b, index) in baokuan" :key="index" style="width: 49%">
        <img :src="b.img" style="width: 100%" />
        <p>{{ b.name }}</p>
        <p>￥{{ b.price }}</p>
      </div>
    </div>
  </div>
</template>
<script>
import axios from "axios";
export default {
  name: "goodsbaokuan",
  data() {
    return {
      baokuan: []
    };
  },
  created(){
      axios({
        url:"/baokuan",
        method:"get"
      }).then((res)=>{
        this.baokuan = res.data;
        console.log(res.data);
      });
    },
};
</script>
<style scoped>
.gengduo {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  margin-top: 0.2rem;
}
.gengduo div {
  margin-top: 0.1rem;
}
.gengduo p:nth-child(2) {
  font-size: 0.1rem;
  padding-left: 0.1rem;
}
.gengduo p:nth-child(3) {
  margin-top: 0.2rem;
  padding-left: 0.1rem;
}
</style>